import axios from '@/utils/axios'

export const getSaying = (id: string): Promise<ApiResult<LiteratureSayingPO>> => {
  return axios.get(`literature/saying/${id}`)
}

export const getSayingPage = (
  pagination: Pagination,
  params: LiteratureSayingPO
): Promise<ApiResult<Page<LiteratureSayingVO>>> => {
  return axios.get(`literature/saying/page/${pagination.page}/${pagination.pageSize}`, { params })
}

export const postOrPutSaying = (data: LiteratureSayingPO): Promise<ApiResult<null>> => {
  return axios.post(`literature/saying`, data)
}

export const deleteSaying = (id: string): Promise<ApiResult<null>> => {
  return axios.delete(`literature/saying/${id}`)
}
